package util;

public class Util{
	public static void JsonTranslate(){
		//翻译Json,用于后端到前端传参
		
		//ObjectNode result = play.libs.Json.newObject();
		//ObjectNode result2 = play.libs.Json.newObject();
		//result.put
	}
	public double calculateAverageData(double[] a, double[] S, int n){
		
		//计算平均年龄，平均郁闭度，平均地位级
		double A = 0;
		double temp = 0;
		
		for(int i = 0; i < n; i++ ){
			A += a[i]*S[i];
			temp += S[i];
		}
		
		A /= temp;
		//精确到一位
		return A;
	}
}
